﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%
	dim nid,tilte,hr,we0,we,sou,dao,zi,zi0,body,dat,dat1
        nid=Request.querystring("nid")
	if nid="" then nid=qingtian.nid 
	if not isnumeric(nid) then nid=qingtian.nid
	nid=clng(nid)
        id=Request.querystring("id")
	if id="" then id=1
	if not isnumeric(id) then id=1
	id=clng(id)
        page=Request.querystring("page")
	if page="" then page=1
	if not isnumeric(page) then page=1
	page=clng(page)

Dim p,gettxt,yd
TP=trim(request.querystring("TP"))
if TP="" or Isnumeric(TP)= false then TP=0
TP=clng(TP)
if TP=1 then 
gettxt="order by id desc"
yd="最新上传"
elseif TP=2 then 
gettxt="order by id desc"
yd="所有相片"
elseif TP=3 then 
gettxt="order by fileCount desc"
yd="人气相片"
elseif TP=4 then 
gettxt="order by photoCount desc"
yd="评论最多"
else
gettxt="order by id asc"
yd="所有相片"
end if
select case v
case "0"
we0="<br/>"
hr="----------------<br/>"
%>
<card title="<%=yd%>"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
%>
<title><%=yd%></title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%
End Select
%>
<%
		if sid<>"Null" then
		qingtian.info
		end if
response.write qingtian.qingsav("550")
response.write dao
response.write "<a href=""photohot.asp?TP=1&amp;sid="&sidd&""">最新</a>"
response.write ""&zi&"."&zi0&"<a href=""photohot.asp?TP=2&amp;sid="&sidd&""">所有</a>"
response.write ""&zi&"."&zi0&"<a href=""photohot.asp?TP=3&amp;sid="&sidd&""">人气</a>"
response.write ""&zi&"."&zi0&"<a href=""photohot.asp?TP=4&amp;sid="&sidd&""">评论</a>"&we0&""
response.write hr
response.write we
set rs=Server.CreateObject("ADODB.Recordset")
if TP=1 then 
rs.open"select top 100 * from qingtian_upfile where smallstr=1 and photoview=0 "&gettxt&"",conn,1,1
else
rs.open"select * from qingtian_upfile where smallstr=1 and photoview=0 "&gettxt&"",conn,1,1
end  if
If Not rs.eof Then
	Dim PageSize,i
	PageSize=5					
	Dim Count,page,pagecount,gopage			
	gopage="photohot.asp?TP="&TP&"&amp;sid="&sidd&"&amp;"
	Count=rs.recordcount			
	pagecount=(count+pagesize-1)\pagesize	
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))
	For i=1 To PageSize     						
	If rs.eof Then Exit For
response.write("<img src='" & rs("smallfiles") & "' alt='图'/><br/>")

response.write""&i+(page-1)*PageSize&"."

if rs("photoContent")<>"" then
response.write"<a href='photoview.asp?id=" & rs("id") & "&amp;nid="&rs("fid")&"&amp;TP=1&amp;sid="&sidd&"'>"&left(rs("photoContent"),15)&"</a>"
else
response.write"<a href='photoview.asp?id=" & rs("id") & "&amp;nid="&rs("fid")&"&amp;TP=1&amp;sid="&sidd&"'>"&left(rs("filesname"),15)&"</a>"
end if
response.write"<br/><a href='../user/spacev.asp?nid="&rs("fid")&"&amp;sid="&sidd&"'>" & rs("username") & "</a>"
dim photoCount
	photoCount=conn.execute("Select count(ID) from [qingtian_photopl] where photoid="&rs("id")&"")(0)	
response.write"(评"&photoCount&"/阅"&rs("fileCount")&")"
response.write"<br/>"
rs.moveNext
Next
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下一页</a>"&chr(13)
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上一页</a>"&chr(13)

response.write "<br/>("&page&"/"&pagecount&")共"&count&"张"
Else
response.write"暂时没有记录！"
end if
rs.close
set rs=nothing
   Response.write we0
   Response.write hr
   response.write qingtian.qingsav("551")
%>
<%=sou%><a href='p.asp?sid=<%=sidd%>'>返回社区相册</a><%=we0%>
 
<%
End Function
%>
